home *** CD-ROM | disk | FTP | other *** search
/ Garbo / Garbo.cdr / mac / hypercrd / hc2_x / untcnvrs.sit / Unit Conversion / card_4845.txt < prev    next >
Text File  |  1990-11-02  |  8KB  |  338 lines

  1. -- card: 4845 from stack: in
  2. -- bmap block id: 7118
  3. -- flags: 0000
  4. -- background id: 3044
  5. -- name: Temperature
  6. ----- HyperTalk script -----
  7. on closeCard
  8.   put empty into background field "toconvert"
  9.   put empty into background field "answer"
  10. end closeCard
  11.  
  12.  
  13.  
  14. -- part 11 (button)
  15. -- low flags: 00
  16. -- high flags: A003
  17. -- rect: left=291 top=54 right=93 bottom=459
  18. -- title width / last selected line: 0
  19. -- icon id / first selected line: 0 / 0
  20. -- text alignment: 1
  21. -- font id: 0
  22. -- text size: 12
  23. -- style flags: 0
  24. -- line height: 16
  25. -- part name: Celsius to Fahrenheit
  26. ----- HyperTalk script -----
  27. on mouseUp
  28.   put empty into background field "answer"
  29.   get first word of background field "toconvert"
  30.   put it into temp
  31.   if temp is "-" then
  32.     get second word of background field "toconvert"
  33.     divide it by -1
  34.     put it into temp
  35.   end if
  36.   put empty into background field "toconvert"
  37.   if temp is empty then
  38.     put temp && "0 ┬░ Celsius" into background field "toconvert"
  39.   else
  40.     put temp && " ┬░ Celsius" into background field "toconvert"
  41.   end if
  42.   multiply temp by 9
  43.   divide temp by 5
  44.   add 32 to temp
  45.   put temp && "┬░ Fahrenheit" into background field "answer"
  46.   put empty into temp
  47. end mouseUp
  48.  
  49.  
  50.  
  51. -- part 12 (button)
  52. -- low flags: 00
  53. -- high flags: A003
  54. -- rect: left=291 top=99 right=136 bottom=461
  55. -- title width / last selected line: 0
  56. -- icon id / first selected line: 0 / 0
  57. -- text alignment: 1
  58. -- font id: 0
  59. -- text size: 12
  60. -- style flags: 0
  61. -- line height: 16
  62. -- part name: Fahrenheit to Celsius
  63. ----- HyperTalk script -----
  64. on mouseUp
  65.   put empty into background field "answer"
  66.   get first word of background field "toconvert"
  67.   put it into temp
  68.   if temp is "-" then
  69.     get second word of background field "toconvert"
  70.     divide it by -1
  71.     put it into temp
  72.   end if
  73.   put empty into background field "toconvert"
  74.   if temp is empty then
  75.     put temp && "0 ┬░ Fahrenheit" into background field "toconvert"
  76.   else
  77.     put temp && " ┬░ Fahrenheit" into background field "toconvert"
  78.   end if
  79.   subtract 32 from temp
  80.   multiply temp by 5
  81.   divide temp by 9
  82.   put temp && "┬░ Celsius" into background field "answer"
  83.   put empty into temp
  84. end mouseUp
  85.  
  86.  
  87. -- part 14 (button)
  88. -- low flags: 00
  89. -- high flags: A003
  90. -- rect: left=292 top=147 right=188 bottom=462
  91. -- title width / last selected line: 0
  92. -- icon id / first selected line: 0 / 0
  93. -- text alignment: 1
  94. -- font id: 0
  95. -- text size: 12
  96. -- style flags: 0
  97. -- line height: 16
  98. -- part name: Celsius to Kelvin
  99. ----- HyperTalk script -----
  100. on mouseUp
  101.   put empty into background field "answer"
  102.   get first word of background field "toconvert"
  103.   put it into temp
  104.   if temp is "-" then
  105.     get second word of background field "toconvert"
  106.     divide it by -1
  107.     put it into temp
  108.   end if
  109.   put empty into background field "toconvert"
  110.   if temp is empty then
  111.     put temp && "0 ┬░ Celsius" into background field "toconvert"
  112.   else
  113.     put temp && " ┬░ Celsius" into background field "toconvert"
  114.   end if
  115.   add 273 to temp
  116.   if temp < 0 then
  117.     answer "That value is below ABSOLUTE ZERO!" with "OK"
  118.     send mouseUp to background button "Clear"
  119.   else
  120.     put temp && "┬░ Kelvin" into background field "answer"
  121.     put empty into temp
  122.   end if
  123. end mouseUp
  124.  
  125.  
  126.  
  127. -- part 15 (button)
  128. -- low flags: 00
  129. -- high flags: A003
  130. -- rect: left=292 top=191 right=230 bottom=464
  131. -- title width / last selected line: 0
  132. -- icon id / first selected line: 0 / 0
  133. -- text alignment: 1
  134. -- font id: 0
  135. -- text size: 12
  136. -- style flags: 0
  137. -- line height: 16
  138. -- part name: Kelvin to Celsius
  139. ----- HyperTalk script -----
  140. on mouseUp
  141.   put empty into background field "answer"
  142.   get first word of background field "toconvert"
  143.   put it into temp
  144.   if temp is "-" then
  145.     get second word of background field "toconvert"
  146.     divide it by -1
  147.     put it into temp
  148.   end if
  149.   put empty into background field "toconvert"
  150.   if temp is empty then
  151.     put 0 into temp
  152.     put "0 ┬░ Kelvin" into background field "toconvert"
  153.   else
  154.     put temp && " ┬░ Kelvin" into background field "toconvert"
  155.   end if
  156.   if temp < 0 then
  157.     answer "That value is below ABSOLUTE ZERO!" with "OK"
  158.     send mouseUp to background button "Clear"
  159.   else
  160.     subtract 273 from temp
  161.     put temp && "┬░ Celsius" into background field "answer"
  162.     put empty into temp
  163.   end if
  164. end mouseUp
  165.  
  166.  
  167.  
  168. -- part 16 (button)
  169. -- low flags: 00
  170. -- high flags: A003
  171. -- rect: left=294 top=283 right=320 bottom=462
  172. -- title width / last selected line: 0
  173. -- icon id / first selected line: 0 / 0
  174. -- text alignment: 1
  175. -- font id: 0
  176. -- text size: 12
  177. -- style flags: 0
  178. -- line height: 16
  179. -- part name: Fahrenheit to Kelvin
  180. ----- HyperTalk script -----
  181. on mouseUp
  182.   put empty into background field "answer"
  183.   get first word of background field "toconvert"
  184.   put it into temp
  185.   if temp is "-" then
  186.     get second word of background field "toconvert"
  187.     divide it by -1
  188.     put it into temp
  189.   end if
  190.   put empty into background field "toconvert"
  191.   if temp is empty then
  192.     put temp && "0 ┬░ Fahrenheit" into background field "toconvert"
  193.   else
  194.     put temp && " ┬░ Fahrenheit" into background field "toconvert"
  195.   end if
  196.   subtract 32 from temp
  197.   multiply temp by 5
  198.   divide temp by 9
  199.   add 273 to temp
  200.   if temp < 0 then
  201.     answer "That value is below ABSOLUTE ZERO!" with "OK"
  202.     send mouseUp to background button "Clear"
  203.   else
  204.     put temp && "┬░ Kelvin" into background field "answer"
  205.     put empty into temp
  206.   end if
  207. end mouseUp
  208.  
  209.  
  210.  
  211. -- part 17 (button)
  212. -- low flags: 00
  213. -- high flags: A003
  214. -- rect: left=293 top=240 right=277 bottom=462
  215. -- title width / last selected line: 0
  216. -- icon id / first selected line: 0 / 0
  217. -- text alignment: 1
  218. -- font id: 0
  219. -- text size: 12
  220. -- style flags: 0
  221. -- line height: 16
  222. -- part name: Kelvin to Fahrenheit
  223. ----- HyperTalk script -----
  224. on mouseUp
  225.   put empty into background field "answer"
  226.   get first word of background field "toconvert"
  227.   put it into temp
  228.   if temp is "-" then
  229.     get second word of background field "toconvert"
  230.     divide it by -1
  231.     put it into temp
  232.   end if
  233.   put empty into background field "toconvert"
  234.   if temp is empty then
  235.     put 0 into temp
  236.     put temp && " ┬░ Kelvin" into background field "toconvert"
  237.   else
  238.     put temp && " ┬░ Kelvin" into background field "toconvert"
  239.   end if
  240.   if temp < 0 then
  241.     answer "That value is below ABSOLUTE ZERO!" with "OK"
  242.     send mouseUp to background button "Clear"
  243.   else
  244.     subtract 273 from temp
  245.     multiply temp by 9
  246.     divide temp by 5
  247.     add 32 to temp
  248.     put temp && "┬░ Fahrenheit" into background field "answer"
  249.     put empty into temp
  250.   end if
  251. end mouseUp
  252.  
  253.  
  254.  
  255. -- part 18 (button)
  256. -- low flags: 00
  257. -- high flags: 2000
  258. -- rect: left=75 top=288 right=304 bottom=134
  259. -- title width / last selected line: 0
  260. -- icon id / first selected line: 0 / 0
  261. -- text alignment: 1
  262. -- font id: 0
  263. -- text size: 12
  264. -- style flags: 0
  265. -- line height: 16
  266. -- part name: Distance
  267. ----- HyperTalk script -----
  268. on mouseUp
  269.   visual effect zoom open
  270.   go to card Distance
  271. end mouseUp
  272.  
  273.  
  274.  
  275. -- part 19 (button)
  276. -- low flags: 00
  277. -- high flags: 2000
  278. -- rect: left=135 top=288 right=304 bottom=194
  279. -- title width / last selected line: 0
  280. -- icon id / first selected line: 0 / 0
  281. -- text alignment: 1
  282. -- font id: 0
  283. -- text size: 12
  284. -- style flags: 0
  285. -- line height: 16
  286. -- part name: Area
  287. ----- HyperTalk script -----
  288. on mouseUp
  289.   visual effect zoom open
  290.   go to card Area
  291. end mouseUp
  292.  
  293.  
  294.  
  295. -- part 20 (button)
  296. -- low flags: 00
  297. -- high flags: 2000
  298. -- rect: left=75 top=306 right=323 bottom=134
  299. -- title width / last selected line: 0
  300. -- icon id / first selected line: 0 / 0
  301. -- text alignment: 1
  302. -- font id: 0
  303. -- text size: 12
  304. -- style flags: 0
  305. -- line height: 16
  306. -- part name: Volume
  307. ----- HyperTalk script -----
  308. on mouseUp
  309.   visual effect zoom open
  310.   go to card Volume
  311. end mouseUp
  312.  
  313.  
  314.  
  315. -- part 21 (button)
  316. -- low flags: 00
  317. -- high flags: 2000
  318. -- rect: left=135 top=306 right=323 bottom=194
  319. -- title width / last selected line: 0
  320. -- icon id / first selected line: 0 / 0
  321. -- text alignment: 1
  322. -- font id: 0
  323. -- text size: 12
  324. -- style flags: 0
  325. -- line height: 16
  326. -- part name: Temperature
  327. ----- HyperTalk script -----
  328. on mouseUp
  329.   visual effect zoom open
  330.   go to card weight
  331. end mouseUp
  332.  
  333.  
  334.  
  335. -- part contents for background part 7
  336. ----- text -----
  337. Temperature
  338. Conversions